<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>http::token_list</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Beast">
<link rel="up" href="../ref.html" title="This Page Intentionally Left Blank 2/2">
<link rel="prev" href="boost__beast__websocket__stream_base__timeout/suggested.html" title="websocket::stream_base::timeout::suggested">
<link rel="next" href="boost__beast__http__token_list/value_type.html" title="http::token_list::value_type">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boost__beast__websocket__stream_base__timeout/suggested.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__http__token_list/value_type.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="beast.ref.boost__beast__http__token_list"></a><a class="link" href="boost__beast__http__token_list.html" title="http::token_list">http::token_list</a>
</h4></div></div></div>
<p>
        A list of tokens in a comma separated HTTP field value.
      </p>
<h5>
<a name="beast.ref.boost__beast__http__token_list.h0"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__token_list.synopsis"></a></span><a class="link" href="boost__beast__http__token_list.html#beast.ref.boost__beast__http__token_list.synopsis">Synopsis</a>
      </h5>
<p>
        Defined in header <code class="literal">&lt;<a href="../../../../../../boost/beast/http/rfc7230.hpp" target="_top">boost/beast/http/rfc7230.hpp</a>&gt;</code>
      </p>
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">token_list</span>
</pre>
<h5>
<a name="beast.ref.boost__beast__http__token_list.h1"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__token_list.types"></a></span><a class="link" href="boost__beast__http__token_list.html#beast.ref.boost__beast__http__token_list.types">Types</a>
      </h5>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
                <p>
                  Name
                </p>
              </th>
<th>
                <p>
                  Description
                </p>
              </th>
</tr></thead>
<tbody>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__http__token_list/const_iterator.html" title="http::token_list::const_iterator">const_iterator</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  A constant iterator to the list.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__http__token_list/value_type.html" title="http::token_list::value_type">value_type</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  The type of each element in the token list.
                </p>
              </td>
</tr>
</tbody>
</table></div>
<h5>
<a name="beast.ref.boost__beast__http__token_list.h2"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__token_list.member_functions"></a></span><a class="link" href="boost__beast__http__token_list.html#beast.ref.boost__beast__http__token_list.member_functions">Member
        Functions</a>
      </h5>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
                <p>
                  Name
                </p>
              </th>
<th>
                <p>
                  Description
                </p>
              </th>
</tr></thead>
<tbody>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__http__token_list/begin.html" title="http::token_list::begin">begin</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Return a const iterator to the beginning of the list.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__http__token_list/cbegin.html" title="http::token_list::cbegin">cbegin</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Return a const iterator to the beginning of the list.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__http__token_list/cend.html" title="http::token_list::cend">cend</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Return a const iterator to the end of the list.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__http__token_list/end.html" title="http::token_list::end">end</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Return a const iterator to the end of the list.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__http__token_list/exists.html" title="http::token_list::exists">exists</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Return <code class="computeroutput"><span class="keyword">true</span></code> if a token
                  is present in the list.
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__http__token_list/token_list.html" title="http::token_list::token_list">token_list</a> <span class="silver">[constructor]</span></strong></span>
                </p>
              </td>
<td>
                <p>
                  Construct a list.
                </p>
              </td>
</tr>
</tbody>
</table></div>
<h5>
<a name="beast.ref.boost__beast__http__token_list.h3"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__token_list.description"></a></span><a class="link" href="boost__beast__http__token_list.html#beast.ref.boost__beast__http__token_list.description">Description</a>
      </h5>
<p>
        This container allows iteration of a list of items in a header field value.
        The input is a comma separated list of tokens. If a parsing error is encountered
        while iterating the string, the behavior of the container will be as if a
        string containing only characters up to but excluding the first invalid character
        was used to construct the list.
      </p>
<h5>
<a name="beast.ref.boost__beast__http__token_list.h4"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__token_list.bnf"></a></span><a class="link" href="boost__beast__http__token_list.html#beast.ref.boost__beast__http__token_list.bnf">BNF</a>
      </h5>
<pre class="programlisting"><span class="identifier">token</span><span class="special">-</span><span class="identifier">list</span>  <span class="special">=</span> <span class="special">*(</span> <span class="string">","</span> <span class="identifier">OWS</span> <span class="special">)</span> <span class="identifier">token</span> <span class="special">*(</span> <span class="identifier">OWS</span> <span class="string">","</span> <span class="special">[</span> <span class="identifier">OWS</span> <span class="identifier">token</span> <span class="special">]</span> <span class="special">)</span>
</pre>
<p>
        To use this class, construct with the string to be parsed and then use <a class="link" href="boost__beast__http__token_list/begin.html" title="http::token_list::begin"><code class="computeroutput"><span class="identifier">begin</span></code></a>
        and <a class="link" href="boost__beast__http__token_list/end.html" title="http::token_list::end"><code class="computeroutput"><span class="identifier">end</span></code></a>, or range-for to iterate each
        item:
      </p>
<h5>
<a name="beast.ref.boost__beast__http__token_list.h5"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__token_list.example"></a></span><a class="link" href="boost__beast__http__token_list.html#beast.ref.boost__beast__http__token_list.example">Example</a>
      </h5>
<pre class="programlisting"><span class="keyword">for</span><span class="special">(</span><span class="keyword">auto</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">token</span> <span class="special">:</span> <span class="identifier">token_list</span><span class="special">{</span><span class="string">"apple, pear, banana"</span><span class="special">})</span>
    <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">token</span> <span class="special">&lt;&lt;</span> <span class="string">"\n"</span><span class="special">;</span>
</pre>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Vinnie
      Falco<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boost__beast__websocket__stream_base__timeout/suggested.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__http__token_list/value_type.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
